function defined(v){ return typeof(v)!='undefined' }
function getElementsByAttr(parent,attrName,value){
var all = parent.all;
	for( var i=0,els=new Array(); i < all.length; i++ )
		if( all[i].getAttribute(attrName)!=null && (!defined(value) || (all[i].getAttribute(attrName)||"").match(value)) )
			els[els.length] = all[i];
	return els;
}
function fillSelect(sel,rs,text,value){
	sel.length = 0;
	for( rs.MoveFirst(); !rs.EOF; rs.MoveNext() )
		sel[sel.length] = new Option(rs(text).value,rs(value).value);
}

